#!/bin/bash

# 所有集群所有软件启动脚本

function node_start()
{
  /home/niit/bin/xCluster.sh start
  sleep 15
  /home/niit/bin/zk.sh start
  sleep 10
  /home/niit/bin/kf.sh start
  sleep 10
  /home/niit/bin/hv.sh start
  sleep 5
  /home/niit/bin/mxw.sh start
  sleep 5
  /home/niit/bin/f1.sh start
  sleep 5
  /home/niit/bin/f2.sh start
  sleep 5
  /home/niit/bin/f3.sh start
  sleep 5
  /home/niit/bin/dolphinscheduler-standalone.sh stop 
  sleep 5
  /home/niit/bin/superset.sh start
  sleep 5
  /home/niit/bin/xRun.sh jps
}

function node_stop()
{
  /home/niit/bin/mxw.sh stop
  sleep 5
  /home/niit/bin/f1.sh stop
  sleep 5
  /home/niit/bin/f2.sh stop
  sleep 5
  /home/niit/bin/f3.sh stop
  sleep 5
  /home/niit/bin/kf.sh stop
  sleep 10
  /home/niit/bin/kf.sh stop
  sleep 10
  /home/niit/bin/hv.sh stop
  sleep 5
  /home/niit/bin/xCluster.sh stop
  sleep 15
  /home/niit/bin/zk.sh stop
  sleep 10
  /home/niit/bin/superset.sh stop
  sleep 5
  /home/niit/bin/dolphinscheduler-standalone.sh stop 
  sleep 5
  /home/niit/bin/xRun.sh jps
}
case $1 in
"start")
  node_start
  ;;
"stop")
  node_stop
  ;;
"restart")
  node_stop
  sleep 10
  node_start
  ;;
*)
  
esac